package com.fly;

import org.apache.commons.lang3.SystemUtils;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class GitBootApplication
{
    public static void main(String[] args)
    {
        SpringApplication.run(GitBootApplication.class, args);
    }
    
    @Bean
    CommandLineRunner init()
    {
        return args -> {
            if (SystemUtils.IS_OS_WINDOWS)// 防止非windows系统报错，启动失败
            {
                Runtime.getRuntime().exec("cmd /c start http://127.0.0.1:8080/");
                Runtime.getRuntime().exec("cmd /c start http://127.0.0.1:8080/doc.html");
            }
        };
    }
}
